{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "**文章转载自「第2大脑」**\n",
    "\n",
    "**摘要：** 当我们手中有一篇文档，比如书籍、小说、电影剧本，若想快速了解其主要内容是什么，则可以采用绘制 WordCloud 词云图，显示主要的关键词（高频词）这种方式，非常方便。本文将介绍常见的英文和中文文本的词云图绘制，以及 Frequency 频词频词云图。\n",
    "\n",
    "这篇文章中详细说明各种形式的词云图绘制步骤。\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/v318sc41jh.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "## **1\\. 英文词云**\n",
    "\n",
    "我们先绘制英文文本的词云图，因为它相对简单一些。这里以《海上钢琴师》这部电影的剧本为例。\n",
    "\n",
    "首先，准备好电影剧本的文本文件（如下图）：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/y09hms7gow.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "接下来，我们绘制一个最简单的矩形词云图，代码如下：\n",
    "\n",
    "```\n",
    " import os\n",
    " from os import path\n",
    " from wordcloud import WordCloud\n",
    " from matplotlib import pyplot as plt\n",
    " # 获取当前文件路径\n",
    " d = path.dirname(__file__) if \"__file__\" in locals() else os.getcwd()\n",
    " # 获取文本text\n",
    " text = open(path.join(d,'legend1900.txt')).read()\n",
    " # 生成词云\n",
    "wc = WordCloud(scale=2,max_font_size = 100)\n",
    "wc.generate_from_text(text)\n",
    "# 显示图像\n",
    "plt.imshow(wc,interpolation='bilinear')\n",
    "plt.axis('off')\n",
    "plt.tight_layout()\n",
    "#存储图像\n",
    "wc.to_file('1900_basic.png')\n",
    "# or\n",
    "# plt.savefig('1900_basic.png',dpi=200)\n",
    "plt.show()\n",
    "```\n",
    "\n",
    "这里，通过 open() 方法读取文本文件，然后在 WordCloud 方法中设置了词云参数，再利用 generate\\_from\\_text() 方法生成该电影剧本的词云，最后显示和保存词云图。十几行代码就可以生成最简单的词云图：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/mwddugipae.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "通过上面的词云图，你可能会发现有几点问题：\n",
    "\n",
    "-   可不可以更换背景，比如白色？\n",
    "-   词云图能不能换成其他形状或者图片？\n",
    "-   词云中最显眼的词汇 「ONE」，并没有实际含义，能不能去掉？\n",
    "\n",
    "以上这些都是可以更改的，如果你想实现以上想法，那么需要先了解一下 WordCloud 的API 参数及它的一些方法。\n",
    "\n",
    "这里，我们列出它的各项参数，并注释重要的几项：\n",
    "\n",
    "```\n",
    " wordcloud.WordCloud(\n",
    "     font_path=None,  # 字体路径，英文不用设置路径，中文需要，否则无法正确显示图形\n",
    "     width=400, # 默认宽度\n",
    "     height=200, # 默认高度\n",
    "     margin=2, # 边缘\n",
    "     ranks_only=None,\n",
    "     prefer_horizontal=0.9,\n",
    "     mask=None, # 背景图形，如果想根据图片绘制，则需要设置\n",
    "     scale=1,\n",
    "    color_func=None,\n",
    "    max_words=200, # 最多显示的词汇量\n",
    "    min_font_size=4, # 最小字号\n",
    "    stopwords=None, # 停止词设置，修正词云图时需要设置\n",
    "    random_state=None,\n",
    "    background_color='black', # 背景颜色设置，可以为具体颜色,比如white或者16进制数值\n",
    "    max_font_size=None, # 最大字号\n",
    "    font_step=1,\n",
    "    mode='RGB',\n",
    "    relative_scaling='auto',\n",
    "    regexp=None,\n",
    "    collocations=True,\n",
    "    colormap='viridis', # matplotlib 色图，可更改名称进而更改整体风格\n",
    "    normalize_plurals=True,\n",
    "    contour_width=0,\n",
    "    contour_color='black',\n",
    "    repeat=False)\n",
    "```\n",
    "\n",
    "关于更详细的用法，你需要到官网了解。\n",
    "\n",
    "了解了各项参数后，我们就可以自定义想要的词云图了。比如更换一下背景颜色和整体风格，就可以通过修改以下几项参数实现：\n",
    "\n",
    "```\n",
    "wc = WordCloud(\n",
    "    scale=2,# 缩放2倍\n",
    "    max_font_size = 100,\n",
    "    background_color = '#383838',# 灰色\n",
    "    colormap = 'Blues')\n",
    "# colormap名称 https://matplotlib.org/examples/color/colormaps_reference.html\n",
    "```\n",
    "\n",
    "结果如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/wn5thxssc3.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "接下来，我们提升一点难度，通过设置 StopWords 去掉没有实际意义的「ONE」字符，然后将词云图绘制在我们自定义的一张图片上。\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/ifh3ll25mz.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "代码实现如下：\n",
    "\n",
    "```\n",
    " import os\n",
    " from os import path\n",
    " import numpy as np\n",
    " from wordcloud import WordCloud,STOPWORDS,ImageColorGenerator\n",
    " from PIL import Image\n",
    " from matplotlib import pyplot as plt\n",
    " from scipy.misc import imread\n",
    " import random\n",
    "\n",
    "def wc_english():\n",
    "    # 获取当前文件路径\n",
    "    d = path.dirname(__file__) if \"__file__\" in locals() else os.getcwd()\n",
    "    # 获取文本text\n",
    "    text = open(path.join(d,'legend1900.txt')).read()\n",
    "    # 读取背景图片\n",
    "    background_Image = np.array(Image.open(path.join(d, \"mask1900.jpg\")))\n",
    "    # or\n",
    "    # background_Image = imread(path.join(d, \"mask1900.jpg\"))\n",
    "    # 提取背景图片颜色\n",
    "    img_colors = ImageColorGenerator(background_Image)\n",
    "    # 设置英文停止词\n",
    "    stopwords = set(STOPWORDS)\n",
    "    wc = WordCloud(\n",
    "        margin = 2, # 设置页面边缘\n",
    "        mask = background_Image,\n",
    "        scale = 2,\n",
    "        max_words = 200, # 最多词个数\n",
    "        min_font_size = 4, # 最小字体大小\n",
    "        stopwords = stopwords,\n",
    "        random_state = 42,\n",
    "        background_color = 'white', # 背景颜色\n",
    "        max_font_size = 150, # 最大字体大小\n",
    "        )\n",
    "    # 生成词云\n",
    "    wc.generate_from_text(text)\n",
    "    # 等价于\n",
    "    # wc.generate(text)\n",
    "    # 根据图片色设置背景色\n",
    "    wc.recolor(color_func=img_colors)\n",
    "    #存储图像\n",
    "    wc.to_file('1900pro1.png')\n",
    "    # 显示图像\n",
    "    plt.imshow(wc,interpolation='bilinear')\n",
    "    plt.axis('off')\n",
    "    plt.tight_layout()\n",
    "    plt.show()\n",
    "```\n",
    "\n",
    "这里，首先通过 open() 方法读取文本文件，Image.open() 方法读取了背景图片，np.array 方法将图片转换为矩阵。\n",
    "\n",
    "接着设置了词云自带的英文 **StopWords 停止词，用来分割筛除文本中不需要的词汇**，比如：a、an、the 这些。\n",
    "\n",
    "然后，在 WordCloud 方法中，设置词云的具体参数。generate\\_from\\_text() 方法生成该词云，recolor() 则是根据图片色彩绘制词云文字颜色。最终的词云绘制效果如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/ybsqb954pm.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "现在，我们还是看到了显眼的「ONE」，下面我们将它去除掉，方法也很简单，几行代码就可以实现：\n",
    "\n",
    "```\n",
    "# 获取文本词排序，可调整 stopwords\n",
    "process_word = WordCloud.process_text(wc,text)\n",
    "sort = sorted(process_word.items(),key=lambda e:e[1],reverse=True)\n",
    "print(sort[:50]) # 获取文本词频最高的前50个词\n",
    "# 结果\n",
    "[('one', 60), ('ship', 47), ('Nineteen Hundred', 43), ('know', 38), ('music', 36), ...]\n",
    "\n",
    "stopwords = set(STOPWORDS)\n",
    "stopwords.add('one')\n",
    "```\n",
    "\n",
    "首先，我们对文本词频进行排序，可以看到 「ONE」词频最高，就将它添加进 stopwords 中，这样就可以屏蔽该词从而不在词云中显示。\n",
    "\n",
    "需要注意的是，**这种手动添加停止词的方法适用于词数量比较少的情况。**\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/3exx3pzbkg.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "另外，我们还可以将词云图颜色显示为黑白渐变色，也只需修改几行代码即可：\n",
    "\n",
    "```\n",
    "def grey_color_func(word, font_size, position, orientation, random_state=None,\n",
    "                    **kwargs):\n",
    "        return \"hsl(0, 0%%, %d%%)\" % random.randint(50, 100)\n",
    "        # 随机设置hsl色值\n",
    "wc.recolor(color_func=grey_color_func)\n",
    "```\n",
    "\n",
    "效果如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/7e3wclp474.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "以上，就是英文词云图绘制的几种方法，下面我们介绍中文词云图的绘制。\n",
    "\n",
    "## **2\\. 中文词云**\n",
    "\n",
    "相比于英文词云，中文在绘制词云图前，需要先切割词汇，这里推荐使用 jieba 包来切割分词。因为它可以说是最好的中文分词包了，GitHub 上拥有 160 K 的 Star 数。安装好 jieba 包后，我们就可以对文本进行分词然后生成词云。\n",
    "\n",
    "这里，选取吴军老师的著作《浪潮之巅》作为中文文本的案例，仍然采用图片形式的词云图。素材准备好后，接下来就可以开始中文词云图绘制。\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/4vzjnw4bib.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "首先，需要读取文本文件，相比于英文，这里要添加文本编码格式，否则会报错，添加几行代码就可以识别文本的编码格式：\n",
    "\n",
    "```\n",
    "text = open(path.join(d,'langchao.txt'),'rb').read()\n",
    "text_charInfo = chardet.detect(text)\n",
    "print(text_charInfo)\n",
    "# 结果\n",
    "{'encoding': 'UTF-8-SIG', 'confidence': 1.0, 'language': ''}\n",
    "text = open(path.join(d,r'langchao.txt'),encoding='UTF-8-SIG').read()\n",
    "```\n",
    "\n",
    "接着，对文本进行分词。jieba 分词有 3 种方式：**精确模式、全模式和搜索引擎模式**，它们之间的差别，可以用一个例子来体现。\n",
    "\n",
    "比如，有这样的一句话：「\"我来到北京清华大学\"」，用 3 种模式进行分词，结果分别如下：\n",
    "\n",
    "-   全模式: 我/ 来到/ 北京/ 清华/ 清华大学/ 华大/ 大学\n",
    "-   精确模式: 我/ 来到/ 北京/ 清华大学\n",
    "-   搜索引擎模式： 我/ 来/ 来到/ 北京/ 清华/ 大学/ 清华大学/\n",
    "\n",
    "根据结果可知，我们应该**选择「精确模式」来分词**。关于 jieba 包的详细用法，可以参考 GitHub 仓库链接：\n",
    "\n",
    "https://github.com/fxsjy/jieba\n",
    "\n",
    "分词完成后，还需要设置 stopwords 停止词，由于 **WordCloud 没有中文停止词，所以需要自行构造**。这里可以采取两种方式来构造：\n",
    "\n",
    "-   通过 stopwords.update() 方法手动添加\n",
    "-   根据已有 stopwords 词库遍历文本筛除停止词\n",
    "\n",
    "### **2.1. stopwords.update() 手动添加**\n",
    "\n",
    "这种方法和前面的英文停止词构造的方法是一样的，目的是在词云图中不显示 stopwords 就行了 ，即先不设置 stopwords，而是先对文本词频进行排序，然后将不需要的词语添加为 stopwords 即可，代码实现如下：\n",
    "\n",
    "```\n",
    "# 获取文本词排序，可调整 stopwords\n",
    "process_word = WordCloud.process_text(wc,text)\n",
    "sort = sorted(process_word.items(),key=lambda e:e[1],reverse=True)\n",
    "print(sort[:50]) # # 获取文本词频最高的前50个词\n",
    "\n",
    "[('公司', 1273), ('但是', 769), ('IBM', 668), ('一个', 616), ('Google', 429), ('自己', 396), ('因此', 363), ('微软', 358), ('美国', 344), ('没有', 334)...]\n",
    "```\n",
    "\n",
    "可以看到，我们先输出文本词频最高的一些词汇后，发现：「但是」、「一个」、「因此」这些词都是不需要显示在词云图中的。因此，可以把这些词用列表的形式添加到 stopwords 中，然后再次绘制词云图就能得出比较理想的效果，完整代码如下：\n",
    "\n",
    "```\n",
    " import chardet\n",
    " import jieba\n",
    " text+=' '.join(jieba.cut(text,cut_all=False)) # cut_all=False 表示采用精确模式\n",
    " # 设置中文字体\n",
    " font_path = 'C:\\Windows\\Fonts\\SourceHanSansCN-Regular.otf'  # 思源黑体\n",
    " # 读取背景图片\n",
    " background_Image = np.array(Image.open(path.join(d, \"wave.png\")))\n",
    " # 提取背景图片颜色\n",
    " img_colors = ImageColorGenerator(background_Image)\n",
    "# 设置中文停止词\n",
    "stopwords = set('')\n",
    "stopwords.update(['但是','一个','自己','因此','没有','很多','可以','这个','虽然','因为','这样','已经','现在','一些','比如','不是','当然','可能','如果','就是','同时','比如','这些','必须','由于','而且','并且','他们'])\n",
    "\n",
    "wc = WordCloud(\n",
    "        font_path = font_path, # 中文需设置路径\n",
    "        margin = 2, # 页面边缘\n",
    "        mask = background_Image,\n",
    "        scale = 2,\n",
    "        max_words = 200, # 最多词个数\n",
    "        min_font_size = 4, #\n",
    "        stopwords = stopwords,\n",
    "        random_state = 42,\n",
    "        background_color = 'white', # 背景颜色\n",
    "        # background_color = '#C3481A', # 背景颜色\n",
    "        max_font_size = 100,\n",
    "        )\n",
    "wc.generate(text)\n",
    "# 获取文本词排序，可调整 stopwords\n",
    "process_word = WordCloud.process_text(wc,text)\n",
    "sort = sorted(process_word.items(),key=lambda e:e[1],reverse=True)\n",
    "print(sort[:50]) # 获取文本词频最高的前50个词\n",
    "# 设置为背景色，若不想要背景图片颜色，就注释掉\n",
    "wc.recolor(color_func=img_colors)\n",
    "# 存储图像\n",
    "wc.to_file('浪潮之巅basic.png')\n",
    "# 显示图像\n",
    "plt.imshow(wc,interpolation='bilinear')\n",
    "plt.axis('off')\n",
    "plt.tight_layout()\n",
    "plt.show()\n",
    "```\n",
    "\n",
    "**stopwords 添加之前：**\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/nahc076vt9.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "**stopwords 添加之后：**\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/p1cg9iigep.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "可以看到，stopwords.update() 这种方法需要手动去添加，比较麻烦一些，而且如果 stopwords 过多的话，添加就比较费时了。下面介绍第 2 种自动去除 stopwords 的方法。\n",
    "\n",
    "### **2.2. stopwords 库自动遍历删除**\n",
    "\n",
    "这种方法的思路也比较简单，主要分为 2 个步骤：\n",
    "\n",
    "-   利用已有的中文 stopwords 词库，对原文本进行分词后，遍历词库去除停止词，然后生成新的文本文件。\n",
    "-   根据新的文件绘制词云图，便不会再出现 stopwords，如果发现 stopwords 词库不全可以进行补充，然后再次生成词云图即可。\n",
    "\n",
    "代码实现如下：\n",
    "\n",
    "```\n",
    " # 对原文本分词\n",
    " def cut_words():\n",
    "     # 获取当前文件路径\n",
    "     d = path.dirname(__file__) if \"__file__\" in locals() else os.getcwd()\n",
    "     text = open(path.join(d,r'langchao.txt'),encoding='UTF-8-SIG').read()\n",
    "     text = jieba.cut(text,cut_all=False)\n",
    "     content = ''\n",
    "     for i in text:\n",
    "         content += i\n",
    "        content += \" \"\n",
    "    return content\n",
    "\n",
    "# 加载stopwords\n",
    "def load_stopwords():\n",
    "    filepath = path.join(d,r'stopwords_cn.txt')\n",
    "    stopwords = [line.strip() for line in open(filepath,encoding='utf-8').readlines()]\n",
    "    # print(stopwords) # ok\n",
    "    return stopwords\n",
    "\n",
    "# 去除原文stopwords,并生成新的文本\n",
    "def move_stopwwords(content,stopwords):\n",
    "    content_after = ''\n",
    "    for word in content:\n",
    "        if word not in stopwords:\n",
    "            if word != '\\t'and'\\n':\n",
    "                content_after += word\n",
    "\n",
    "    content_after = content_after.replace(\"   \", \" \").replace(\"  \", \" \")\n",
    "    # print(content_after)\n",
    "    # 写入去停止词后生成的新文本\n",
    "    with open('langchao2.txt','w',encoding='UTF-8-SIG') as f:\n",
    "        f.write(content_after)\n",
    "```\n",
    "\n",
    "网上有很多中文 stopwords 词库资料，这里选取了一套包含近 2000 个词汇和标点符号的词库：stopwords\\_cn.txt，结构形式如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/inv4ry4v5m.png?imageView2/2/w/1620)\n",
    "\n",
    "遍历该 stopwords 词库，删除停止词获得新的文本，然后利用第一种方法绘制词云图即可。\n",
    "\n",
    "首先输出一下文本词频最高的部分词汇，可以看到常见的停止词已经没有了：\n",
    "\n",
    "```\n",
    "[('公司', 1462), ('美国', 366), ('IBM', 322), ('微软', 320), ('市场', 287), ('投资', 263), ('世界', 236), ('硅谷', 235), ('技术', 234), ('发展', 225), ('计算机', 218), ('摩托罗拉', 203)...]\n",
    "```\n",
    "\n",
    "词云图最终效果如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/iebzvjkwn9.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "## **3\\. Frenquency 词云图**\n",
    "\n",
    "上面两种中英文词云图都是通过文本绘制的，而除了直接读入文本生成词云以外，比较常见的还有通过「词频」绘制词云图。这种词云图，则可以使用 **DataFrame** 或者 **字典格式** 来绘制。\n",
    "\n",
    "下面，以此前我们爬过的一篇「[近十年 世界大学排名 TOP500 强](http://mp.weixin.qq.com/s?__biz=MzA5NDk4NDcwMw==&mid=2651385873&idx=1&sn=4e5abf3e7559fe8c7a4820732f42efe4&chksm=8bba1081bccd9997b2f13e2e7bd9fb02c717d80367add1f0592859a3221849a44d2c0de149fc&scene=21#wechat_redirect)」教程的数据为例，介绍如何绘制词频词云图。\n",
    "\n",
    "该份数据大小为 5001行 x 6 列，我们想根据各国 TOP 500 强大学的数量，来可视化地展示各国之间的大学数量差异。\n",
    "\n",
    "```\n",
    " world_rank    university  score   quantity    year    country\n",
    " 1    哈佛大学    100 500 2009    USA\n",
    " 2    斯坦福大学   73.1    499 2009    USA\n",
    " 3    加州大学-伯克利    71  498 2009    USA\n",
    " 4    剑桥大学    70.2    497 2009    UK\n",
    " 5    麻省理工学院  69.5    496 2009    USA\n",
    " ...\n",
    " 496    犹他州立大学      2018    USA\n",
    " 497    圣拉斐尔生命健康大学      2018    Italy\n",
    "498    早稻田大学       2018    Japan\n",
    "499    韦恩州立大学      2018    USA\n",
    "500    西弗吉尼亚大学     2018    USA\n",
    "```\n",
    "\n",
    "这里，有两种方式可以直接生成频率词云图，第一种是 利用 Series 列表生成，代码实现如下：\n",
    "\n",
    "```\n",
    " import pandas as pd\n",
    " import matplotlib.dates as mdate\n",
    " from wordcloud import WordCloud\n",
    " import matplotlib.pyplot as plt\n",
    "\n",
    " df = pd.read_csv('university.csv',encoding = 'utf-8')\n",
    " df = df.groupby(by = 'country').count()\n",
    " df = df['world_rank'].sort_values(ascending = False)\n",
    " print(df[:10])\n",
    "# 结果如下：\n",
    "country\n",
    "USA               1459\n",
    "Germany            382\n",
    "UK                 379\n",
    "China              320\n",
    "France             210\n",
    "Canada             209\n",
    "Japan              206\n",
    "Australia          199\n",
    "Italy              195\n",
    "Netherlands        122\n",
    "```\n",
    "\n",
    "第二种方式是转换为 dict 字典生成，一行代码就可以完成：\n",
    "\n",
    "```\n",
    "df = dict(df)\n",
    "print(df)\n",
    "# 结果如下：\n",
    "{'USA': 1459, 'Germany': 382, 'UK': 379, 'China': 320, 'France': 210,..}\n",
    "```\n",
    "\n",
    "数据转换好以后，就可以生成词云图了，代码实现如下：\n",
    "\n",
    "```\n",
    " font_path='C:\\Windows\\Fonts\\SourceHanSansCN-Regular.otf'  # 思源黑\n",
    " wordcloud = WordCloud(\n",
    "     background_color = '#F3F3F3',\n",
    "     font_path = font_path,\n",
    "     width = 5000,\n",
    "     height = 300,\n",
    "     margin = 2,\n",
    "     max_font_size = 200,\n",
    "     random_state = 42,\n",
    "    scale = 2,\n",
    "    colormap = 'viridis',  # 默认virdis\n",
    "    )\n",
    "wordcloud.generate_from_frequencies(df)\n",
    "# or\n",
    "# wordcloud.fit_words(df)\n",
    "plt.imshow(wordcloud,interpolation = 'bilinear')\n",
    "plt.axis('off')\n",
    "plt.show()\n",
    "```\n",
    "\n",
    "效果如下：\n",
    "\n",
    "![](https://ask.qcloudimg.com/http-save/yehe-1558117/dfjwls8z67.jpeg?imageView2/2/w/1620)\n",
    "\n",
    "可以看到，美国最为突出，其次是德国、英国、中国等。看来，我们国内的大学还得加把劲啊。\n",
    "\n",
    "以上，就是绘制词云图常见的几种方式。\n",
    "\n",
    "本文完。\n",
    "\n",
    "文中代码可以在下面的链接中获取：\n",
    "\n",
    "https://github.com/makcyun/eastmoney\\_spider"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
